package com.example.demo.service;

import com.example.demo.dao.ArticleMapper;
import com.example.demo.model.Articleinfo;
import com.example.demo.model.Userinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    public List<Articleinfo> getListByUid(int uid){
        return articleMapper.getListByUid(uid);
    }

    public int del(int id,int uid){
        return articleMapper.del(id,uid);
    }

    public int insertByUid(Articleinfo articleinfo){
        return articleMapper.insertByUid(articleinfo);
    }

    public Articleinfo getArticleByIdAndUid(int id,int uid){
        return articleMapper.getArticleByIdAndUid(id,uid);
    }

    public int updateByIdAndUid(Articleinfo articleinfo){
        return articleMapper.updateByIdAndUid(articleinfo);
    }

    public Articleinfo getDetail(int id){
        return articleMapper.getDetail(id);
    }

    public int getartCountByUid(int uid){
        return articleMapper.getartCountByUid(uid);
    }

    public int incrementrcount(int id){
        return articleMapper.incrementrcount(id);
    }

    public List<Articleinfo> getlists(int psize,int offset){
        return articleMapper.getlists(psize,offset);
    }

    public int getcount(){
        return articleMapper.getcount();
    }
}
